#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"
#include "cardTest2.h"


//This is one of my refactored cards

//Function tests council room card
int cardTest2() {  
  int seed = 1000;
  int numPlayer = 2;

  int k[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, village, baron, great_hall};

  struct gameState G;
  
  printf("=========================\n TESTING COUNCIL ROOM \n=========================\n");
  
  initializeGame(numPlayer, k, seed, &G);
  
  if(G.handCount[0]==5){
  	printf("TEST PASSED: Hand Count before council room is %d\n", G.handCount[0]);
  } else {
  	printf("TEST FAILED: Hand Count before council room is %d\n", G.handCount[0]);
  }
    
  cardEffect(council_room, 0, 0, 0, &G, 1, 0);
  
  //Number of buys should be 2  
  //assert(G.numBuys == 2 );
  
  if(G.numBuys == 2){
  	printf("TEST PASSED: Number of buys is %d\n", G.numBuys);
  } else {
  	printf("TEST FAILED: Number of buys is %d\n", G.numBuys);
  }
  
  //Other players draw a card (player 1)
  //assert(G.handCount[1]==1);
  
  if(G.handCount[1]==1){
  	printf("TEST PASSED: Other players have %d card in their hand\n", G.handCount[1]);
  } else {
  	printf("TEST FAILED: Other players have %d card in their hand\n", G.handCount[1]);
  }
  
  //After adding a smithy, 4 cards will be added to the hand. One one card is discarded
  printf("[[ This will fail because of my change in week 1, so assertion ]]\n");
  
  if(G.handCount[0]==8){
  	printf("TEST PASSED: Hand Count after council room is %d\n", G.handCount[0]);
  } else {
  	printf("TEST FAILED: Hand Count after council room is %d\n", G.handCount[0]);
  }
  
  //One card should be played 
  if(G.playedCardCount==1){
  	printf("TEST PASSED: Number of cards played: %d\n", G.playedCardCount);
  } else {
  	printf("TEST FAILED: Number of cards played: %d\n", G.playedCardCount);
  }

  return 0;
}